Port ?perf=1 timing panel to Search Explorer (baseline step)#124
Merged
rdhyee merged 1 commit intoisamplesorg:mainfrom Apr 17, 2026
Merged
Port ?perf=1 timing panel to Search Explorer (baseline step)#124rdhyee merged 1 commit intoisamplesorg:mainfrom
rdhyee merged 1 commit intoisamplesorg:mainfrom
Conversation
First step toward the Explorer rethink: establish measured baseline for the current slow implementation before touching architecture. Adds performance.mark() hooks at four natural boundaries: - explorer_db (DuckDB init + CREATE VIEW for samples/sample_facets) - explorer_facets (2 KB facet summaries load) - explorer_count (COUNT(*) on wide parquet through WHERE clause) - explorer_samples (ORDER BY RANDOM() LIMIT N on wide parquet — the slow one) New perfPanel cell gated on ?perf=1. Also shows ?v=2 in the header so v1 vs v2 numbers can be compared side-by-side in follow-up PR. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
rdhyee
added a commit
to rdhyee/isamplesorg.github.io
that referenced
this pull request
Apr 17, 2026
…RANDOM, lazy Cesium) Four architectural moves, each gated on ?v=2. v1 stays unchanged. 1. Primary read surface: samples_map_lite.parquet (60 MB) instead of wide.parquet (278 MB). The lite file has every column the Explorer needs for the list + globe view except description. 2. No ORDER BY RANDOM(). v1 uses RANDOM() which forces a scan across row groups; v2 uses bare LIMIT, accepting row-order bias in exchange for ~20× query speedup on columnar parquet. (Trade-off acceptable for a viz sample; revisit if source clustering becomes visible.) 3. Lazy description fetch. v2 drops description from sampleData and adds a lazyDescription cell that queries wide.parquet for just the one pid when a sample is clicked. sampleCard falls back to lazyDescription when s.description is empty. 4. Lazy Cesium mount. v2 returns null from the viewer cell until viewMode === 'globe', so the viewer constructor (~500 ms) doesn't run for users who stay in list/table view. v1 mounts eagerly. whereClause handles column-name drift (v1 uses `n`, v2 uses `source`) and skips the otype filter for v2 (lite is samples-only). Text search in v2 is limited to label + place_name (description isn't loaded eagerly). v1 keeps description search. Next: measure v2 and compare against the PR isamplesorg#124 baseline. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
rdhyee
added a commit
to rdhyee/isamplesorg.github.io
that referenced
this pull request
Apr 17, 2026
…RANDOM, lazy Cesium) Four architectural moves, each gated on ?v=2. v1 stays unchanged. 1. Primary read surface: samples_map_lite.parquet (60 MB) instead of wide.parquet (278 MB). The lite file has every column the Explorer needs for the list + globe view except description. 2. No ORDER BY RANDOM(). v1 uses RANDOM() which forces a scan across row groups; v2 uses bare LIMIT, accepting row-order bias in exchange for ~20× query speedup on columnar parquet. (Trade-off acceptable for a viz sample; revisit if source clustering becomes visible.) 3. Lazy description fetch. v2 drops description from sampleData and adds a lazyDescription cell that queries wide.parquet for just the one pid when a sample is clicked. sampleCard falls back to lazyDescription when s.description is empty. 4. Lazy Cesium mount. v2 returns null from the viewer cell until viewMode === 'globe', so the viewer constructor (~500 ms) doesn't run for users who stay in list/table view. v1 mounts eagerly. whereClause handles column-name drift (v1 uses `n`, v2 uses `source`) and skips the otype filter for v2 (lite is samples-only). Text search in v2 is limited to label + place_name (description isn't loaded eagerly). v1 keeps description search. Next: measure v2 and compare against the PR isamplesorg#124 baseline. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
rdhyee
added a commit
that referenced
this pull request
Apr 17, 2026
…RANDOM, lazy Cesium) (#126) Four architectural moves, each gated on ?v=2. v1 stays unchanged. 1. Primary read surface: samples_map_lite.parquet (60 MB) instead of wide.parquet (278 MB). The lite file has every column the Explorer needs for the list + globe view except description. 2. No ORDER BY RANDOM(). v1 uses RANDOM() which forces a scan across row groups; v2 uses bare LIMIT, accepting row-order bias in exchange for ~20× query speedup on columnar parquet. (Trade-off acceptable for a viz sample; revisit if source clustering becomes visible.) 3. Lazy description fetch. v2 drops description from sampleData and adds a lazyDescription cell that queries wide.parquet for just the one pid when a sample is clicked. sampleCard falls back to lazyDescription when s.description is empty. 4. Lazy Cesium mount. v2 returns null from the viewer cell until viewMode === 'globe', so the viewer constructor (~500 ms) doesn't run for users who stay in list/table view. v1 mounts eagerly. whereClause handles column-name drift (v1 uses `n`, v2 uses `source`) and skips the otype filter for v2 (lite is samples-only). Text search in v2 is limited to label + place_name (description isn't loaded eagerly). v1 keeps description search. Next: measure v2 and compare against the PR #124 baseline. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First of two PRs for the Explorer rethink. Establishes measured baseline before any architectural changes.
Adds
performance.mark()at four natural boundaries (DuckDB init, facet summaries, count query, sample data query) plus the same perfPanel pattern from the Interactive Explorer (PR #118). Gated on?perf=1.Follow-up PR will add
?v=2feature flag with the lite-parquet + lazy-description + no-RANDOM + lazy-Cesium rewrite, measured on the same panel for apples-to-apples.🤖 Generated with Claude Code